package com.lemon.blog.web.controller;

import com.lemon.blog.web.domain.BlMusic;
import com.lemon.blog.web.service.IBlMusicService;
import com.lemon.common.core.web.controller.BaseController;
import com.lemon.common.core.web.domain.AjaxResult;
import com.lemon.common.core.web.page.TableDataInfo;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;

/**
 * 包名称：com.lemon.blog.controller
 * 类名称：BlMusicController
 * 类描述：音乐欣赏Controller
 * 创建人：@author huangpeng
 * 创建时间：2022-05-04
 */
@Api("音乐信息")
@RestController
@RequestMapping("/music")
public class BlMusicController extends BaseController {
    @Autowired
    private IBlMusicService blMusicService;

    /**
     * @Title: list
     * @Description: 查询音乐欣赏列表
     * @param blMusic 音乐欣赏
     * @return: TableDataInfo
     * @throws:
     * @author: huangpeng
     * @Date: 2022-05-04
     */
    @GetMapping("/list")
    public TableDataInfo list(BlMusic blMusic)
    {
        startPage();
        List<BlMusic> list = blMusicService.selectBlMusicList(blMusic);
        return getDataTable(list);
    }

    /**
     * @Title: getInfo
     * @Description: 获取音乐欣赏详细信息
     * @param id 音乐欣赏主键
     * @return: AjaxResult
     * @throws:
     * @author: huangpeng
     * @Date: 2022-05-04
     */
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return AjaxResult.success(blMusicService.selectByPrimaryKey(id));
    }
}
